//package tech.wisefin.track.session;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Configurable;
//import tech.wisefin.track.EvidenceProvider;
//import tech.wisefin.track.TrackConfiguration;
//
//import javax.persistence.PostPersist;
//import java.io.File;
//import java.io.IOException;
//
//@Slf4j
//@Configurable
//public class VideoEvidenceListener {
//
//    @Autowired
//    private TrackConfiguration config;
//
//    @Autowired
//    private SessionTrackRepository trackRepo;
//
//    @Autowired
//    private EvidenceProvider provider;
//
//    @PostPersist
//    public void provideEvidence(SessionTrack track) throws IOException {
//        if (track.isLocked()) {
//            log.warn(track.getSession() + "，SessionTrack 已被锁定");
//
//        }
//        File file = new File(config.getLocalPath(), track.getVideoFileName());
//        String evidence = provider.provide(file);
//        track.setEvidence(evidence);
//        trackRepo.save(track);
//    }
//}
